embed youtube videos in posts
Posted by nevasport
|
embed youtube videos in posts November 08, 2006 10:53AM |
Registered: 22 years ago Posts: 130 |
|
Re: embed youtube videos in posts November 08, 2006 11:22AM |
Registered: 22 years ago Posts: 130 |
Seems quite simple:
[youtube]http://www.youtube.com/watch?v=k1fwPU2C_kk[/youtube]
should return this:
[youtube]http://www.youtube.com/watch?v=k1fwPU2C_kk[/youtube]
should return this:
<object width="425" height="350"><param name="movie" value="[www.youtube.com] name="wmode" value="transparent"></param><embed src="[www.youtube.com]; type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>
|
Re: embed youtube videos in posts November 08, 2006 12:26PM |
Admin Registered: 25 years ago Posts: 4,499 |
|
Re: embed youtube videos in posts November 08, 2006 12:29PM |
Registered: 22 years ago Posts: 130 |
|
Re: embed youtube videos in posts November 09, 2006 09:44AM |
Registered: 23 years ago Posts: 687 |
This seems to work using the Simple Text Replacement module.
Remember to change the comparison type from string to PCRE.
Paste the following in directly:
String to match:
Replacement:
Hope this helps someone.
Also, if anyone can see a mistake, or possible security risk, please let me know!
/\dam
--
My notable Phorum sites:
Movie Deaths Database - "review comments" system mostly powered by Phorum
Learn Chinese! - integrated forum quiz
Remember to change the comparison type from string to PCRE.
Paste the following in directly:
String to match:
[youtube\](.*?)[\/youtube\]
Replacement:
<object width="425" height="350"><param name="movie" value="\1"></param><param name="wmode" value="transparent"></param><embed src="\1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>
Hope this helps someone.
Also, if anyone can see a mistake, or possible security risk, please let me know!
/\dam
--
My notable Phorum sites:
Movie Deaths Database - "review comments" system mostly powered by Phorum
Learn Chinese! - integrated forum quiz
|
Re: embed youtube videos in posts November 09, 2006 09:47AM |
Registered: 23 years ago Posts: 687 |
If someone feels like posting the mods needed to add this tag to Maurice's enhanced text / smiley editor that would be appreciated! :D
/\dam
--
My notable Phorum sites:
Movie Deaths Database - "review comments" system mostly powered by Phorum
Learn Chinese! - integrated forum quiz
/\dam
--
My notable Phorum sites:
Movie Deaths Database - "review comments" system mostly powered by Phorum
Learn Chinese! - integrated forum quiz
|
Re: embed youtube videos in posts January 08, 2007 03:19PM |
Registered: 19 years ago Posts: 35 |
|
Re: embed youtube videos in posts February 10, 2007 07:36AM |
Registered: 20 years ago Posts: 14 |
I added two lines of code to the bbcode mod:
Add this line at the end of the $search = array(
and following to the end of the $replace = array(
To insert video to a message, just copy (only!) the Url from embedding-code between the videotags, like
[video]http://www.youtube.com/v/ekcYc3zrJHI[/video]
Works for youtube and google as well!
Add this line at the end of the $search = array(
"/[video\](.+?)[\/video\]/is",
and following to the end of the $replace = array(
"<embed style=\"width:400px; height:326px;\" id=\"VideoPlayback\" type=\"application/x-shockwave-flash\" src=\"$1\" flashvars=\"\"> </embed>",
To insert video to a message, just copy (only!) the Url from embedding-code between the videotags, like
[video]http://www.youtube.com/v/ekcYc3zrJHI[/video]
Works for youtube and google as well!
|
Re: embed youtube videos in posts June 13, 2007 06:30AM |
Admin Registered: 21 years ago Posts: 8,532 |
I wrote a module which can be used to display YouTube and Google URLs as embedded video
I discovered that there was more to it than the above to make it work easy for my users. Especially the fact that they will simply copy and paste video viewing page URLs instead of the actual video resource URLs, in which case the video would not load. That made it necessary to do some more work.
Currently, the module only supports YouTube and Google URLs, because I do not simply run [video] tag replacements but do some URL analyzing as well. Different video sources require different URL handling in my mod. Unknown resources are still displayed as a link to the video page.
See this thread for the module.
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
Edited 1 time(s). Last edit at 06/13/2007 07:11AM by mmakaay.
I discovered that there was more to it than the above to make it work easy for my users. Especially the fact that they will simply copy and paste video viewing page URLs instead of the actual video resource URLs, in which case the video would not load. That made it necessary to do some more work.
Currently, the module only supports YouTube and Google URLs, because I do not simply run [video] tag replacements but do some URL analyzing as well. Different video sources require different URL handling in my mod. Unknown resources are still displayed as a link to the video page.
See this thread for the module.
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauceEdited 1 time(s). Last edit at 06/13/2007 07:11AM by mmakaay.
Sorry, only registered users may post in this forum.